#pragma once

#include <hacks/base/hacks_conf.h>

namespace hacks {
    class spin_lock {
    public:
        spin_lock();

        ~spin_lock() = default;

        bool try_lock();

        void lock();

        void unlock();

    private:
        std::atomic_bool is_lock_;
    };

    typedef std::lock_guard<hacks::spin_lock> spin_lock_guard;
}

